package com.demo.sys.entity.resp;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
/**
 * <p>返回用户密码</p>
 *@author zwy
 *@date 2025/3/2 16:58
*/

public class RespontLoginEntity implements UserDetails {
    private static final long serialVersionUID = -6451374906652014879L;
    List<GrantedAuthority> roles=new ArrayList<>();
    private String password;
    private String username;
    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return null;
    }
    public List<GrantedAuthority> getRoles() {
        return roles;
    }
    @Override
    public String getPassword() {
        return password;
    }
    @Override
    public String getUsername() {
        return username;
    }
    public void setRoles(List<GrantedAuthority> roles) {
        this.roles = roles;
    }
    public void setPassword(String password) {
        this.password = password;
    }
    public void setUsername(String username) {
        this.username = username;
    }
    /**
     * 账户是否过期
     * @return
     */
    @Override
    public boolean isAccountNonExpired() {
        return true;
    }
    /**
     * 账户是否锁定
     * @return
     */
    @Override
    public boolean isAccountNonLocked() {
        return true;
    }
    /**
     * 凭据未过期
     * @return
     */
    @Override
    public boolean isCredentialsNonExpired() {
        return true;
    }
    /**
     * 已启用
     * @return
     */
    @Override
    public boolean isEnabled() {
        return true;
    }
}
